package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.*;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GelAllFilesByNIO {

	public static void main(String[] args) {
		Path listDir = Paths.get("E:\\CODE\\JAVA\\ReviewCode\\src\\StudyCode\\");
		ListTree1 walk = new ListTree1();

		try {
			Files.walkFileTree(listDir, walk);
		} catch (IOException e) {
			System.err.println(e);
		}
	}
}

class ListTree extends SimpleFileVisitor<Path> {

	@Override
	public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
		System.out.println( dir.toString());
		return FileVisitResult.CONTINUE;
	}

	@Override
	public FileVisitResult visitFileFailed(Path file, IOException exc) {
		System.out.println(exc);

		return FileVisitResult.CONTINUE;
	}
}